import { color } from "echarts";
import { reactive, ref } from "vue";

export function useOptions() {
  const statusOptions = ref([
    { label: "未开始", value: "未开始" },
    { label: "进行中", value: "进行中" },
    { label: "已完成", value: "已完成" },
    { label: "异常中", value: "异常中" },
  ]);
  const month = [
    "1月",
    "2月",
    "3月",
    "4月",
    "5月",
    "6月",
    "7月",
    "8月",
    "9月",
    "10月",
    "11月",
    "12月",
  ];
  const time = [
    "0:00",
    "2:00",
    "4:00",
    "6:00",
    "8:00",
    "10:00",
    "12:00",
    "14:00",
    "16:00",
    "18:00",
    "20:00",
    "22:00",
    "24:00",
  ];
  // const year:any=ref([])
  const nowYear = () => {
    return new Date().getFullYear();
  };
  const year = () => {
    const currentYear = new Date().getFullYear();
    const data: any = [];
    for (let year = currentYear - 4; year <= currentYear; year++) {
      data.push({ value: year.toString(), label: year.toString() });
    }
    return data;
  };
  const monthOptions = () => {
    let data: any = [];
    for (let i = 0; i < 12; i++) {
      data.push({ value: i, label: month[i] });
    }

    return data;
  };
  const tenyear = () => {
    const currentYear = new Date().getFullYear();
    const data: any = [];
    for (let year = currentYear - 9; year <= currentYear; year++) {
      data.push(year.toString());
    }
    return data;
  };
  const colors = ref([
    "#5CE1FF",
    "#96E0ED",
    "#60FFCE",
    "#E6FDFF",
    "#03E6FE",
    "#159AFF",
  ]);
  const hanyangSubdistricts = ref([
    "晴川街道",
    "龙阳街道",
    "建桥街道",
    "鹦鹉街道",
    "洲头街道",
    "四新街道",
    "五里墩街道",
    "琴断口街道",
    "江汉二桥街道",
    "永丰街道",
    "江堤街道",
    "汉阳经济开发区",
    "四新地区管委会",
  ]);
  const projectList = ref([
    "晴川项目",
    "龙阳项目",
    "建桥项目",
    "鹦鹉项目",
    "洲头项目",
    "四新项目",
    "五里墩项目",
    "琴断口项目",
    "江汉二桥项目",
    "永丰项目",
    "江堤项目",
  ]);
  const paishuiList: any = [
    { label: "琴断口", value: 0 },
    { label: "曹家碑", value: 1 },
    { label: "杨泗港", value: 2 },
    { label: "龟山北", value: 3 },
    { label: "鹦鹉湖", value: 4 },
    { label: "鹦鹉洲", value: 5 },
    { label: "汉钢西", value: 6 },
    { label: "三角湖", value: 7 },
    { label: "墨水湖", value: 8 },
  ];
  const projectTypeList = [
    { label: "污水收集完善", value: 0 },
    { label: "源头小区海绵建设", value: 1 },
    { label: "面源污染控制", value: 2 },
    { label: "内涝治理及生态修复", value: 3 },
    { label: "内涝防治", value: 4 },
  ];

  const watherSystem = [
    { label: "月湖系统", value: 0 },
    { label: "墨水湖系统", value: 1 },
    { label: "莲花湖系统", vallue: 2 },
    { label: "龙阳湖系统", value: 3 },
  ];

  const deviceList = [
    { label: "液位监测仪", value: 0, color: "#5CE1FF" },
    { label: "雨量监测仪", value: 1, color: "#B8EB8F" },
    { label: "监控视频(市政)", value: 2, color: "#FFA240" },
    { label: "水质监测仪", value: 3, color: "#FBD8A0" },
    { label: "流量监测仪", value: 4, color: "#60FFCE" },
  ];

  const hbData = [
    {
      label: "月湖",
      value: 0,
    },
    {
      label: "墨水湖",
      value: 1,
    },
    {
      label: "莲花湖",
      value: 2,
    },
    {
      label: "龙阳湖",
      value: 3,
    },
  ];

  const waterWatchType = [
    { label: "雨量及雨水排放量监测", value: 0 },
    { label: "地表水水质监测", value: 1 },
    { label: "雨量监测", value: 2 },
    { label: "积水点液位监测", value: 3 },
  ];

  const waterUnit = [{ label: "PH", value: 0 }];

  const waterSite = [{ label: "四新北路地下通道积水点", value: 0 }];

  const guanxianType = [
    "排水管线",
    "给水管线",
    "通信管线",
    "电力管线",
    "天然气管线",
    "专用管线",
  ];

  const fswName = ["变压器", "控制柜", "阀门", "排气阀", "排污阀", "消防栓"];

  const colorList = [
    "#5CE1FF",
    "#159AFF",
    "#60FFCE",
    "#B8EB8F",
    "#97FF5C",
    "#96E0ED",
    "#FE7E1D",
    "#7B7FDE",
    "#E6FDFF",
    "#FBD8A0",
    "#FF7B88",
    "#03E6FE",
    "#B051E9",
  ];

  const levelList = [
    { label: "高", value: 1, color: "#FF5D5D" },
    { label: "中", value: 2, color: "#FE7E1D" },
    { label: "低", value: 3, color: "#5CE1FF" },
  ];

  const statusList = [
    { label: "未处置", value: 1, color: "#FFEFB1" },
    { label: "处理中", value: 2, color: "#03E6FE" },
    { label: "已处置", value: 3, color: "#00FFB1" },
  ];

  return {
    statusOptions,
    colors,
    hanyangSubdistricts,
    month,
    projectList,
    year,
    nowYear,
    monthOptions,
    paishuiList,
    tenyear,
    projectTypeList,
    watherSystem,
    deviceList,
    hbData,
    waterWatchType,
    waterUnit,
    time,
    waterSite,
    guanxianType,
    fswName,
    colorList,
    levelList,
    statusList
  };
}
